// 基础用户类型
export interface BaseUser {
  _id: string;
  username: string;
  image: string;
}

// 扩展的用户类型（包含登录状态）
export interface User extends BaseUser {
  isLoggedIn: boolean;
}

// 群组成员类型（与 GroupChat 组件匹配）
export interface GroupMember extends User {
  nickname?: string;
}

// 群组类型
export interface Group {
  _id: string;
  name: string;
  members: GroupMember[];
  admin?: string;
  description?: string;
  qrCode?: string;
  announcement?: string;
  createdBy: BaseUser;
  createdAt: string;
}

// 统一的聊天项接口
export interface ChatItem {
  _id: string;
  username: string;
  name: string;
  image: string;
  type: 'user' | 'group';
  isTop: boolean;
  data?: User | Group;
}
